<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/layouts/include/taglib.jsp" %> 


<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta name="decorator" content="step" />

<style type="text/css">
	/*模态提示框样式  start*/
	.modal-backdrop {
	  position: fixed;
	  top: 0;
	  right: 0;
	  bottom: 0;
	  left: 0;
	  z-index: 1030;
	  background-color: #FFFFFF;
	}
	
	.modal-backdrop.in {
	  opacity: 0.2;
	  filter: alpha(opacity=50);
	}
	/*模态提示框样式  end*/

</style>

<script type="text/javascript">
	var tpId = "${param.tpId}";			//项目id
	
</script>

</head>
<body >
<div class="page-header">
	<h1>新增模板<small></small></h1>
</div>

<div class="step-main">
        <div class="row">
            <div class="breadcrumbs" id="breadcrumbs">
            </div>
            <div class="step-header">
                <h1><i class="icon icon-caret-right"></i> 模板维护</h1>
                <div class="btn-group pull-right">
                        <a href="#" class="btn btn-primary" onclick='addStep(this);return false;'>
                            <i class="icon-plus"></i>
                            新建
                        </a>

                        <a href="#" class="btn btn-success" onclick="loadStep();return false;">
                            <i class="icon-refresh"></i>
                            重载
                        </a>
                </div>
                <a href="#" class="btn-ace pull-right" onclick='toTpList();return false;'>
                            <i class="icon-reply"></i>
                            列表
                </a>
            </div>
        </div>

        <div class="step-content">
            <div class="col-xs-12" style="height:100%">
                <div class="steprow thin-scroll" id="stepRow">

                </div>
            </div>
        </div>
        
        
        <!-- 阶段 -->
        <div class="modal"  id="stepModen"><!-- class="modal fade" 添加效果 -->
				<div class="modal-dialog" style="width:250px;">
				    <div class="modal-content" >
				      <div class="modal-header">
				        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				        <h4 class="modal-title">新增阶段</h4>
				      </div>
				      <div class="modal-body">
				        <form class="form-horizontal" role="form" id="stepModen-form">
				        	<div class="form-group">
				        		<label class="col-sm-4 control-label no-padding-right" for="stepName" > 阶段名 </label>
		
								<div class="col-sm-8">
									<input type="hidden" name="uuid"/>
									<input type="hidden" name="tpId"/>
									<input type="text" name="stepName" placeholder="阶段名" class="col-sm-12" required="required"/>
								</div>
				        	</div>
				        	
				        </form>
				      </div>
				      <div class="modal-footer">
				        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				        <button type="button" class="btn btn-primary" id="stepModen-btn-save">保存</button>
				      </div>
				    </div><!-- /.modal-content -->
			  	</div><!-- /.modal-dialog -->
		</div><!-- /.modal -->
			
		<!-- 任务 -->
		<div class="modal"  id="taskModen">
				<div class="modal-dialog">
				    <div class="modal-content">
				      <div class="modal-header">
				        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				        <h4 class="modal-title">任务</h4>
				      </div>
				      <div class="modal-body">
				        <form class="form-horizontal" role="form" id="taskModen-form">
				        	<div class="form-group">
				        		<label class="col-sm-4 control-label no-padding-right" for="taskName"> 任务名 </label>
		
								<div class="col-sm-8">
									<input type="hidden" name="uuid"/>
									<input type="hidden" name="tpId"/>
									<input type="hidden" name="stepTpId"/>
									<input type="text" name="taskName" placeholder=任务名" class="col-sm-12" required="required"/>
								</div>
				        	</div>
				        	
				        	<div class="form-group">
				        		<label class="col-sm-4 control-label no-padding-right" for="taskType">类型</label>
		
								<div class="col-sm-8">
									<tags:select type="pmTaskType" name="taskType" id="taskType"></tags:select>
								</div>
				        	</div>
				        </form>
				      </div>
				      <div class="modal-footer">
				        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				        <button type="button" class="btn btn-primary" id="taskModen-btn-save">保存</button>
				      </div>
				    </div><!-- /.modal-content -->
			  	</div><!-- /.modal-dialog -->
		</div><!-- /.modal -->
		
		
		
		<!-- 模板新建 -->
		<div class="modal" id="addTpModen" data-backdrop="false">
				<div class="modal-dialog">
				    <div class="modal-content" style="width:250px;">
				      <div class="modal-header">
				        <h4 class="modal-title">新建模板</h4>
				      </div>
				      <div class="modal-body">
				        <form class="form-horizontal" role="form" id="tpModen-form">
				        	<div class="form-group">
				        		<label class="col-sm-4 control-label no-padding-right" for="tpName">模板名称</label>
		
								<div class="col-sm-8">
									<input type="hidden" name="uuid"/>
									<input type="text" name="tpName" placeholder="模板名称" class="col-sm-12" required="required"/>
								</div>
				        	</div>
				        	<div class="form-group">
				        		<label class="col-sm-4 control-label no-padding-right" for="prjType">项目类型 </label>
		
								<div class="col-sm-8">
									<tags:select type="pmProjectType" name="prjType" id="prjType"></tags:select>
								</div>
				        	</div>
				        </form>
				      </div>
				      <div class="modal-footer">
				       <button type="button" class="btn  btn-default" id="" onclick='toTpList();return false;' >取消</button>
				        <button type="button" class="btn btn-primary" id="tpModen-btn-save">保存</button>
				      </div>
				    </div><!-- /.modal-content -->
			  	</div><!-- /.modal-dialog -->
		</div><!-- /.modal -->
</div>


<!-- 阶段模板 -->
<script id="stepMtp" type="x-tmpl-mustache">
	<div class="u-step" id="step-wrap-{{stepId}}">
		<div class="widget-box transparent">
			<div class="widget-header">
				<h4>{{stepName}}</h4>
				<div class="widget-toolbar">
					 <a href="#" data-action="reload">
						<i class="icon-refresh"></i>
					</a>
					 <a href="#" class="step-btn-edit " data-action="settings" stepName="{{stepName}}" key="{{stepId}}">
						<i class="icon-edit"></i>
					</a>
					 <a href="#" class="red step-btn-delete " data-action="settings" key="{{stepId}}">
						<i class="icon-remove"></i>
					</a>
				</div>
			</div>
			<div class="widget-body thin-scroll">
				<div class="widget-main">
					<ul class="item-list" id="step-wrap-ul-{{stepId}}">
						<a class="f-mb15 task-add-span" href="#" key="{{stepId}}">添加任务</a>
						{{#taskArray}}
							{{> taskItemLink}}
						{{/taskArray}}
					</ul>
				</div>
			</div>
		</div>
	</div>
</script>


<!-- 任务项模板 -->
<script id="taskItemMtp" type="x-tmpl-mustache">
	<li class="item-green clearfix" id="task-item-panel-{{uuid}}">
		<label class="inline">
			<span class="lbl">{{taskName}}</span>
		</label>
		<div class="pull-right action-buttons">
			<a href="#" class="red item-btn-delete "  key="{{uuid}}">
				<i class="icon-trash bigger-130"></i>
			</a>
			<span class="vbar"></span>
			<a href="#" class="blue item-btn-edit " key="{{uuid}}">
				<i class="icon-pencil bigger-130"></i>
			</a>
			<span class="vbar"></span>
			<a href="#" class="blue item-btn-view" key="{{uuid}}">
				<i class="icon-eye-open bigger-130"></i>
			</a>
			<span class="vbar"></span>
		</div>
	</li>
</script>



<!-- 任务新增模板 -->
<script id="taskAddMtp" type="x-tmpl-mustache">
	<li class="item-task-add clearfix" id="task-wrap-{{stepId}}">
		<form class="form-horizontal" role="form" id="task-save-form">
			<div class="row">
				<div class="col-sm-12 f-mb10">
					<input type="hidden" name="uuid"/>
					<input type="hidden" name="tpId"  value="{{tpId}}"/>	  {{!tpId jsp页面全局变量}}
					<input type="hidden" name="stepTpId" value="{{stepId}}"/>
					<input type="hidden" name="empNo"/>
					<input type="hidden" name="endDate"/>
					<input type="text" name="taskName" placeholder="任务名" class="col-sm-12"/>
				</div>
				<div class="col-sm-12 f-mb10" id="divTaskType">
				</div>
				<div class="col-sm-12 f-mb10">
					<textarea class="form-control limited" name="depict" placeholder="描述" maxlength="200"></textarea>
				</div>
				<div class="col-sm-12 f-mb10 clearfix">
					<button type="button" class="btn btn-primary submit-handler pull-right" data-toggle="button" id="task-btn-save">创建</button>
					<button type="button" class="btn btn-link cancel-handler pull-right" data-toggle="button" id="task-btn-cancle">取消</button>
				</div>
				</div> 
			</div> 
		</form>
	</li>
</script>

 
<span style="display:none;">
	<div id="tagsSelect">
		<tags:select type="pmTaskType" name="taskType" id="taskType"></tags:select>
	</div>
</span>

   

<script type="text/javascript" src="stepTp.js"></script>   


</body>

